package mn.idax.exchange.otc.constant;

import java.math.BigDecimal;
import java.math.MathContext;

/**
 * Create by jack_huang on 2018/8/8
 */
public class CommonConstant {

    public static final String DATE_FORMAT_PATTREN = "yyyy-MM-dd HH:mm:ss";
    public static final String UTC_DATE_FORMAT_PATTREN = "yyyy-MM-dd'T'HH:mm:ss";

    //更新完订单状态后后发送消息
    public static final String SENDORDERSTATANDORDERNUM = "OTC_ORDER_STATE_CHANGE_EVENT";
    // 推送通知的topic
    public static final String PUSH_NOTIFY_TOPIC = "OTC_PUSH_NOTIFY_TOPIC";

    //评价内容为空时显示
    public static final String COMMENTCONTENTISEMPTY = "COMMENTCONTENTISEMPTY";

    //评价内容为空时显示
    public static final String DIGITAL_ASSETS = "DIGITAL_ASSETS";

    //订单状态修改后 发送消息的senderId==系统
    public static final Integer SENDERID = 0;

    public static final Long MAX_CANCEL_ORDER_NUM = 3L;

    /**
     * 获取币种人名币实时价格请求地址
     * 1.通过https://api.coinmarketcap.com/v1/ticker 获取列表，详情中对应ID传值即可
     * 2.如占位符号：bitcoin，ethereum，ripple，eos等
     **/
    public static final String COINMARKETCAP_COIN_PRICE_CNY_URL = "https://api.coinmarketcap.com/v1/ticker/{0}/?convert={1}";

    //手续费固定费率
    public static final BigDecimal COINFEERATE = new BigDecimal("0.0001");

    //手续费固定费率
    public static final BigDecimal HUNDRED = new BigDecimal("100");

    //手续费保留的位数
//    public static final MathContext PRECISION = new MathContext(8);

    public static final String STATE_ONE = "1";
    public static final String STATE_TWO = "2";
    public static final String STATE_THREE = "3";

    //好评保留位数
    public static final int COMMENTDECIMAL = 4;

    //支付超时时间
    public static final int PAYTIMEOUT = 15;

    //广告详情页面国际化
    public static final String ADTRADENOTIFIED = "ADTRADENOTIFIED";

    /**
     * 邮件类型
     */
    public static class EmailType {
        /** 下单-卖单 */
        public static final int DOWN_ORDER_SELL = 101;
        /** 标识付款-发给卖家 */
        public static final int IDENTIFICATION_PAYMENT_SELLER = 102;
        /** 放行-发给买家 */
        public static final int RELEASE_BUYER = 103;
        /** 下单-买单 */
        public static final int DOWN_ORDER_BUY = 104;
        /** 标识付款-发给买家 */
        public static final int IDENTIFICATION_PAYMENT_BUYER = 105;
        /** 放行-发给卖家 */
        public static final int RELEASE_SELLER = 106;
        /** 发给申诉方*/
        public static final int ARBITRATION_CREATE_TO_APPEALER = 107;
        /** 发给被申诉方 */
        public static final int ARBITRATION_CREATE_TO_BEAPPEALER = 108;
        /** 仲裁完成 申诉方 成立  */
        public static final int ARBITRATION_FINISH_TO_APPEALER_WIN = 109;
        /** 仲裁完成 被申诉方 成立   */
        public static final int ARBITRATION_FINISH_TO_BEAPPEALER_WIN = 110;
        /** 仲裁完成 申诉方 不成立  */
        public static final int ARBITRATION_FINISH_APPEALER_LOSE = 111;
        /** 仲裁完成 被申诉方 不成立  */
        public static final int ARBITRATION_FINISH_BEAPPEALER_LOSE= 112;

    }

    /**
     * .net亚马逊消息推送类型
     */
    public static class SqsType {
        /** 短信*/
        public static final int sms = 1;
        /** 邮箱*/
        public static final int email = 2;
        /** 短信+邮箱*/
        public static final int smsAndEmail = 3;
    }

    /**
     * 语言类型
     */
    public static class LangType {
        /** zh_cn*/
        public static final String ZH_CN = "zh_cn";
        /** en_us*/
        public static final String EN_US = "en_us";
    }

    /**
     * 订单类型
     */
    public static class OrderType {
        /** 1 买*/
        public static final int buy = 1;
        /** 2 卖*/
        public static final int seller = 2;
    }

    public static final String  MARKET_VALUATION_CNY = "Exchange.Setting:.MarketValuationCny";


    public static final Long FLOATPRICE_TIMEOUT = 20000L;

    public static final String REDIS_COINMARKET_BTC = "OTC:COINMARKET:BTC";
    public static final String REDIS_ORDER_ID_KEY = "OTC:ORDER:ID";


    public static final String Forbid_Otc_User = "HashForbidOtcCreateOrderUsers";

    //OTC下单开关
    public static final String OTC_CREATEORDER_SWITCH = "OTCCreateOrderSwitch";

    //OTC撤单开关
    public static final String OTC_CANCELORDER_SWITCH = "OTCCancelOrderSwitch";

    //OTC BITCNY兑人民币价格
    public static final String OTC_BITCNY_LASTPRICE = "OTCBITCNYLastPrice";

    //OTC CZZ兑美元价格
    public static final String OTC_CZZ_LASTPRICE = "OTCCZZLastPrice";

    //BITCNY浮动率
    public static final String OTC_BITCNY_FLOATRATE = "OTCBITCNYFloatRate";

    public static final String OTC_BIAN_SYSTEM = "otc_bian_system";
    public static final String OTC_HUOBI_SYSTEM = "otc_huobi_system";


}
